package com.zac.coroutine.simpleUtils

/**
 * author zac
 * date 2024/10/25
 *
 */
class WorkTimeCalculator {

    companion object {
        @JvmStatic
        fun main(args: Array<String>) {

            cal(listOf(2000,2030,2034,2036,2030,2031,2100,2002,2038,2131))
//            modifyNames()
//            show()
        }


        fun cal(list: List<Int>) {
            var totalMin = 0
            list.forEach {
                val hour = it.toString().substring(0, 2).toInt() - 18
                val min = it.toString().substring(2, 4).toInt()
                totalMin += (hour * 60) + min
            }

            println("总加班时长(分钟): $totalMin")
            println("总加班时长(小时): ${totalMin / 60}")

        }

        fun show() {
            for (i in 0 until 119) {
                val no = if (i < 10) {
                    "00$i"
                } else if (i < 100) {
                    "0$i"
                } else {
                    i.toString()
                }
                println(
                    "   <item\n" +
                            "        android:drawable=\"@drawable/ota_anim_${no}\"\n" +
                            "        android:duration=\"100\" />"
                )
            }
        }

        fun modifyNames() {
            batchRenameLocalImages("F:\\钉钉文件保存路径\\升级序列帧", "ota_anim_", 0)
        }

    }

}